Preserve composer drafts during Refresh - #14
Merged
Merged
Conversation
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Retained-draft rows must expose their selected state with aria-current for accessibility.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
Open (1)
What changed in this PR
Preserves composer drafts, attachments, modes, and navigation across refreshes, including drafts for removed plan items.
Changes:
- Captures drafts before applying refresh results and on failure.
- Retains removed-item drafts with submission disabled.
- Adds browser regression coverage and implementation documentation.
| File | Description |
|---|---|
web/public/app.js |
Preserves drafts and renders retained drafts. |
test/browser/review.spec.ts |
Adds refresh preservation regressions. |
docs/implementation/read-only-review.md |
Records lifecycle ownership and validation evidence. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Refresh captured a draft before starting its request, so typing while it was in flight could be replaced with older text. It also hid drafts when a refreshed plan removed their item.
Capture the latest draft immediately before applying refreshed state and on failure. Preserve current mode, navigation, and valid attachments. Keep removed-item drafts accessible with submission disabled and instructions to copy the text to a current item; stale snippets retain their existing reselect warning. Drafts remain page-local.
Validation at final head
2def722: typecheck, 188 unit/integration tests, and 38 browser tests pass in CI; both push and PR workflows are green. The final local done-when check (npm run test:browser -- --grep 'during refresh') passes all six cases. Five held-refresh cases failed before the fix; failed-refresh recovery already passed. Working tree and diff checks are clean.Review round 1: fixed the missing aria-current attribute on retained-draft rows. The browser assertion failed before the fix and passed afterward, checking selection, navigation away, and selection again. The thread is resolved; no findings were declined. Round 2 reviewed
2def722and returned Findings: None, with approval recommended. No unresolved threads remain.The implementation note records state ownership and regression evidence. Follow-ups #10, #12, and the human go/no-go experiment in #3 remain outside this change.
Closes #13.